<div class="ui-grid-row ui-widget-content" style="height:65%;">
    <div class="ui-g">
        <p-table #dt [columns]="cols" [value]="fields" [scrollable]="true" [(selection)]="selectedFields"
            [scrollHeight]="'450px'" dataKey="fieldId">
            <ng-template pTemplate="caption">
                <div style="text-align: right;">
                    <i class="fa fa-search" style="margin:4px 4px 0 0"></i>
                    <input type="text" pInputText size="50" placeholder="输入关键字查询..."
                        (input)="dt.filterGlobal($event.target.value, 'contains')" style="width:auto">
                </div>
            </ng-template>
            <ng-template pTemplate="header" let-columns>
                <tr>
                    <th style="width: 3em">
                        <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
                    </th>
                    <th style="width: 4em"> 序号 </th>
                    <th *ngFor="let col of columns" [ngStyle]="col.style">
                        {{col.header}}
                    </th>
                </tr>
            </ng-template>

            <ng-template pTemplate="body" let-rowData let-columns="columns" let-rowIndex="rowIndex">
                <tr [pSelectableRow]="rowData" style="height: 35px;">
                    <td style="width: 3em">
                        <p-tableCheckbox [value]="rowData"></p-tableCheckbox>
                    </td>
                    <td style="width: 4em">{{rowIndex + 1 }}</td>
                    <ng-container *ngFor="let col of columns;">
                        <td [ngStyle]="col.style"> {{ rowData[col.field] }} </td>
                    </ng-container>
                </tr>
            </ng-template>
        </p-table>
    </div>
</div>
<div class="ui-grid-row">
    <div class="button-item">
        <button pButton type="text" class="ui-button-danger" icon="fa fa-times" label="取消" (click)="cancel()"></button>
        <button pButton type="text" class="ui-button-info" icon="fa fa-plus" label="保存" (click)="save()"></button>
    </div>
</div>